// fast4j - Fast & Agile Service Tools for Java
// Copyright (C) 2007 Alexandre ROMAN
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

// $Id: ServiceBridgeException.java 7 2007-03-24 02:02:46Z alexandre.roman $

package fast4j.ejbbridge;

/**
 * Service bridge exception, embedding context attached to service call.
 * @author alexandre.roman
 */
public class ServiceBridgeException extends Exception {
    private static final long serialVersionUID = 1L;
    private final ServiceCall call;
    
    public ServiceBridgeException(final String message, final Throwable cause,
            final ServiceCall call) {
        super(message, cause);
        this.call = call;
    }
    
    public ServiceBridgeException(final String message, final ServiceCall call) {
        this(message, null, call);
    }
    
    /**
     * Returns the {@link ServiceCall} involved with this exception.
     */
    public final ServiceCall getServiceCall() {
        return call;
    }
}
